package com.lijing.RegExp;

import java.util.Arrays;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class RegExpDemo1 {
    public static void main(String[] args) {
        String str = "lijing0123dingding5678";
        Pattern p = Pattern.compile("\\d+");
        Matcher m = p.matcher(str);
        while (m.find()){
            System.out.println(m.group());
        }
        String[] s = str.split("\\d");
        System.out.println(Arrays.toString(s));
        String newStr = m.replaceAll("*");
        System.out.println(newStr);
    }
}
